<style> .colorBtn01{ padding:2px;} </style>
<style>
.lt_css th{height:35px;background-color:#F0F6FF;cursor:pointer}
.disClc{background:#FCF9CE;margin:5px;padding:2px 5px 2px 5px}
.onClc{background:#D9DC00;}
</style>

<script>
var _lotto_id = {lotto_id};
$(function(){
  $("div#errormsg").text("赔率更新中...请稍等...");
  $("div#mainPageData").hide();
  
  $().getR3data(_lotto_id,_gametype);
  
  // 切换赔率
  $("select#slcDisk").change(function(){
    $("input#disk").attr("value",$("select#slcDisk option:selected").val());
    $().getR3data(_lotto_id,_gametype);
  });
 
  // 0-9 号码选择
  $("span#slcNumBtnGroup input:button").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("tbody#tbdr20 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr20 input:"+timebtnType).getNum3($(this).index()).val("*").css('background-color', '#ffff8c');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr20 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr20 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  // 对对 号码选择
  $("input#slcPair2Num").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("tbody#tbdr20 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr20 input:"+timebtnType).getPairNum2().val("*").css('background-color', '#ffff8c');
    $("tbody#tbdr20 input:"+timebtnType).getPairNum3().val("").css('background-color', '');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr20 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr20 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  // 豹子 号码选择
  $("input#slcPair3Num").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("tbody#tbdr20 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr20 input:"+timebtnType).getPairNum3().val("*").css('background-color', '#ffff8c');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr20 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr20 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  
  // 一般 号码选择
  $("input#slcPair4Num").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("tbody#tbdr20 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr20 input:"+timebtnType).getPairNum4().val("*").css('background-color', '#ffff8c');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr20 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr20 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  
  // 快选
  $("input#slcChgQuickPG").click(function(){
    
    window.top.mainFrame.location.href = '{reloadUrl}&qFast=1&subid=' + $('input:[name="subid"]:checked').val() ;
  });
  
  
  // 画面切换
  $("div#rdiSubid input:radio").click(function(){
    var nowIdx = $(this).val();
    var nowDisk = $("#slcDisk").val();
    location.replace('{reloadUrl}&subid=' + nowIdx + "&disk=" + nowDisk);
  });
  
  $("#rdoQuickPair").html(crt_rdoQuickPair());
  
  // 全选
  $("fieldset#fldQuickPair input:checkbox#chkCheckAll").click(function(){
    if($(this).attr("checked")){
      $("fieldset#fldQuickPair input:checkbox[id!=chkCheckAll]").attr("checked","checked").attr("disabled","true");
    }else{
      $("fieldset#fldQuickPair input:checkbox").removeAttr("checked").removeAttr("disabled");
    }
  });
  
  // 组三 / 组六 转直
  $("fieldset#fldQuickPair input").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("td#divBtnQuick01 span").removeClass("btnchoiced").addClass("btnchoice");
    var addStr = "";
    var getTypeVal = $("fieldset#fldQuickPair input:radio:checked").val();
    var addArr = new Array();
    var tempI = 0;
    var chkValArr = new Array();
    chkValArr[0] = new Array("001","002","003","004","005","006","007","008","009","011","022","033","044","055","066","077","088","099","112","113","114","115","116","117","118","119","122","133","144","155","166","177","188","199","223","224","225","226","227","228","229","233","244","255","266","277","288","299","334","335","336","337","338","339","344","355","366","377","388","399","445","446","447","448","449","455","466","477","488","499","556","557","558","559","566","577","588","599","667","668","669","677","688","699","778","779","788","799","889","899");
    chkValArr[1] = new Array("012","013","014","015","016","017","018","019","023","024","025","026","027","028","029","034","035","036","037","038","039","045","046","047","048","049","056","057","058","059","067","068","069","078","079","089","123","124","125","126","127","128","129","134","135","136","137","138","139","145","146","147","148","149","156","157","158","159","167","168","169","178","179","189","234","235","236","237","238","239","245","246","247","248","249","256","257","258","259","267","268","269","278","279","289","345","346","347","348","349","356","357","358","359","367","368","369","378","379","389","456","457","458","459","467","468","469","478","479","489","567","568","569","578","579","589","678","679","689","789");
    chkValArr[2] = new Array();
    chkValArr[3] = new Array();
    chkValArr[4] = new Array();
    if(getTypeVal == 2){
     $("fieldset#fldQuickPair input:checkbox").filter(function(){
        var chkVal = $(this).val();
        if(chkVal == "10"){ return true; } 
        if(chkVal == "11"){ return true; }
        if(chkVal == "12"){ return true; }
        if(chkVal == "13"){ return true; }
        return false;
     }).add("#chkCheckAll").removeAttr("checked").attr("disabled", "disabled");
       chkValArr[2] = new Array();
       var tempNum = "";
       for(var i = 0; i < 10; i++){
        for(var j = i; j < 10; j++){
          for(var k = j; k < 10; k++){
            tempNum = "" + i + j + k;
            chkValArr[2].push(tempNum);
          }
        }
       }
    }else if(getTypeVal == 3){
       chkValArr[3] = new Array();
       var tempNum = "";
       var checkStr = "";
       for(var i = 0; i < 10; i++){
        for(var j = i; j < 10; j++){
          for(var k = j; k < 10; k++){
            tempNum = "" + i + j + k;
            checkStr = "," + (j - i) + "," + (k - i) + "," + (k - j) + ",";
            if( (checkStr.indexOf(",1,") > -1) || (checkStr.indexOf(",9,") > -1)){
              chkValArr[3].push(tempNum);
            }
          }
        }
       }
    }else if(getTypeVal == 4){
       chkValArr[4] = new Array();
       var tempNum = "";
       var checkStr = "";
       for(var i = 0; i < 10; i++){
        for(var j = i; j < 10; j++){
          for(var k = j; k < 10; k++){
            tempNum = "" + i + j + k;
            checkStr = "," + (j - i) + "," + (k - i) + "," + (k - j) + ",";
            if( (checkStr.indexOf(",1,") < 0) && (checkStr.indexOf(",9,") < 0)){
              chkValArr[4].push(tempNum);
            }
          }
        }
       }
    }
    if(getTypeVal != 2){ $("fieldset#fldQuickPair input:checkbox:disabled").removeAttr("disabled", "disabled"); }
    var chkNumArr = new Array();
    //var chkNumArr2 = new Array();
    var tempI = 0;
    var chkFlag =false; var chkFlag10=false;var chkFlag11=false;var chkFlag12=false;var chkFlag13=false;
    $("fieldset#fldQuickPair input:checkbox:checked").each(function(idx){
        tempI = $(this).val();
        switch(tempI){
          case "chkAll": addArr = chkValArr[getTypeVal];return false;break;
          case "10":chkFlag10=true;break;
          case "11":chkFlag11=true;break;
          case "12":chkFlag12=true;break;
          case "13":chkFlag13=true;break;
          default:
          chkNumArr.push(tempI);
          //chkNumArr2.push(tempI + '' + tempI);
          break;
        }
    });
    var myNumStr = chkNumArr.join(",");
    //var myNumStr2 = chkNumArr2.join("|");
    if(chkNumArr.length > 0){
      chkFlag = true;
      var patt1 = new RegExp("["+myNumStr +"]");
      //var patt2 = eval("new RegExp(/(" + myNumStr2 +")/i)");
    }
      
    var chkArr = new Array();
    if(chkFlag && (getTypeVal == 2)){
      if(chkNumArr.length > 2){
        var tempIdx = "";
        var l = chkNumArr.length
        for(i = 0; i < l; i++){
          for(j = (i+1); j < l; j++){
            for(k = (j+1); k < l; k++){
              tempIdx = "" + chkNumArr[i] + chkNumArr[j] + chkNumArr[k];
              addArr.push(tempIdx);  
            }  
          }  
        }
      }
    }else{
      for(idx in chkValArr[getTypeVal]){
        addThreeNum = $().addThreeNum(chkValArr[getTypeVal][idx]);
        if(chkFlag && chkValArr[getTypeVal][idx].match(patt1)){
          addArr.push(chkValArr[getTypeVal][idx]);
        }else if(chkFlag10 && (addThreeNum % 2 == 1)){
          addArr.push(chkValArr[getTypeVal][idx]);
        }else if(chkFlag11 && (addThreeNum % 2 == 0)){
          addArr.push(chkValArr[getTypeVal][idx]);
        }else if(chkFlag12 && (addThreeNum>13)){
          addArr.push(chkValArr[getTypeVal][idx]);
        }else if(chkFlag13 && (addThreeNum<14)){
          addArr.push(chkValArr[getTypeVal][idx]);
        }
      }
    }
    var tempStr = "";
    $("tbody#tbdr20 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr20 input:"+timebtnType).getPairByArr(addArr).val("*").css('background-color', '#ffff8c');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr20 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr20 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr20 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  
  $("input:reset").click(function(){
    $("input").css('background-color', '');
    $("fieldset#fldQuickPair input:checkbox:disabled").removeAttr("disabled", "disabled");     
  });
  //路途
  $(".disClc").bind("click",function(b){
		var row=$(this).attr("tag");
		$("#lt_table tr[class='td2']").hide();
		$(".onClc").removeClass("onClc");
		$(this).addClass("onClc");
		$("#lt_tr_"+row).show();
	});
	$("input[type=reset]").bind("click",function(){$(".k1").removeClass("k1");});
});

// 组三、组六转值
function crt_rdoQuickPair(){
  var str = "";
  var i = 0;
  str += "<fieldset id='fldQuickPair' style='font-weight:bold;width:700px' class='bgClc_{gametype}'>";
  str += "<input type='radio' name='rdoQuickPair' id='rdoQuickPair01' checked='checked' value='0' /><label for='rdoQuickPair01' class='blueblod'>组三转直</label>&nbsp;";
  str += "<input type='radio' name='rdoQuickPair' id='rdoQuickPair02' value='1' /><label for='rdoQuickPair02' class='blueblod'>组六转直</label>&nbsp;";
  str += "<input type='radio' name='rdoQuickPair' id='rdoQuickPair03' value='2' /><label for='rdoQuickPair03' class='blueblod'>包车</label>&nbsp;";
  str += "<input type='radio' name='rdoQuickPair' id='rdoQuickPair04' value='3' /><label for='rdoQuickPair04' class='blueblod'>连号</label>&nbsp;";
  str += "<input type='radio' name='rdoQuickPair' id='rdoQuickPair05' value='4' /><label for='rdoQuickPair05' class='blueblod'>不连号</label>&nbsp;";
  str += "<br />[<label><input type='checkbox' id='chkCheckAll' value='chkAll' />全选</label>&nbsp;";
  for(i = 0; i < 10; i++){
    str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='" + i + "' />" + i + "</label>&nbsp;";
  }
  
  str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='10' />合单</label>&nbsp;";
  str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='11' />合双</label>&nbsp;";
  str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='12' />合大</label>&nbsp;";
  str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='13' />合小</label>&nbsp;";
  str += "&nbsp;]&nbsp;";
  str += "</fieldset>";
  return str;    
}

</script>
<div id="errormsg"></div>
<div id="mainPageData">
<form action="{action}" method="post" name="form1" style="margin-top:0">
<input type="hidden" value="{timebtnType}" name="timebtnType" id="timebtnType" />
<input type="hidden" value="" name="disk" id="disk" />
<div class="msgBox-inGray" style="width:700px;font-weight:900;color:#0000A0" id="rdiSubid">
<label {lblClass2}><input type="radio" value="2" name="subid" {chkSubid2} />前三</label>
<label {lblClass1}><input type="radio" value="1" name="subid" {chkSubid1} />中三</label>
<label {lblClass0}><input type="radio" value="0" name="subid" {chkSubid0} />後三</label>
</div>
<br />

<span id="slcNumBtnGroup"> 
<input type="button" value="0" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="1" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="2" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="3" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="4" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="5" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="6" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="7" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="8" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="9" class="colorBtn01 clrBrd_{gametype}" />
</span>
<span>
<input type="button" value="对对" id="slcPair2Num" class="colorBtn01 clrBrd_{gametype}"  />
<input type="button" value="豹子" id="slcPair3Num" class="colorBtn01 clrBrd_{gametype}"  />
<input type="button" value="一般" id="slcPair4Num" class="colorBtn01 clrBrd_{gametype}"  />
<label class="colorBtn01 clrBrd_{gametype}"><input type="checkbox" id="slcChgQuickPG" value="1" />显示快选</label>
</span>
<div id="rdoQuickPair"></div>
<br />
金额
<input type="text" value="" id="setMomney" size="3" />
<input type="button" id="btnSetMyNum" value="转送" />

<input type="submit" value="确定" />
<input type="reset" value="取消" />


<br />
<table class="tblMy3D" width="700">
<caption class="title0 bgImg_{gametype}" style="font-size:14px;">{subidStr}◎三字组合</caption>
<thead>
<tr class="td15">
<th>号码</th>
<th>赔率</th>
<th>选择</th>
<th>号码</th>
<th>赔率</th>
<th>选择</th>
<th>号码</th>
<th>赔率</th>
<th>选择</th>
<th>号码</th>
<th>赔率</th>
<th>选择</th>
<th>号码</th>
<th>赔率</th>
<th>选择</th>
</tr>
</thead>
<tbody id="tbdr20">

</tbody>  
</table>




</form>

</div>
<div>
{lt_table}
</div>   